<div class="blazorise-codeblock">
<div class="csharp"><pre>
<span class="keyword">public</span> <span class="keyword">class</span> RegistrationViewModelValidator : AbstractValidator&lt;RegistrationViewModel&gt;
{
    <span class="keyword">public</span> RegistrationViewModelValidator()
    {
        RuleFor(x =&gt; x.EmailAddress).EmailAddress().NotEmpty();
        RuleFor(x =&gt; x.Password).NotEmpty().Length(<span class="number">1</span>, <span class="number">24</span>);
    }
}
</pre></div>
</div>
